package com.aqie.optimize.service.impl;

import com.aqie.optimize.service.IBaseService;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;

/**
 * @author: aqie
 * @create: 2020-12-24 22:07
 **/
@Service
public class BaseServiceImpl implements IBaseService, ApplicationContextAware {
    private ApplicationContext applicationContext;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }

    @Override
    public String getProperty(String property) {
        return applicationContext.getEnvironment().getProperty(property);
    }
}
